<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="">
<head>
    <meta charset="UTF-8">
    <title>欢迎页面</title>
    <!-- 预连接CDN + 异步加载样式 -->
    <link rel="preconnect" href="https://cdn.jsdelivr.net">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"
          media="print" onload="this.media='all'">
    <noscript><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"></noscript>

    <!-- 精简压缩后的内联样式 -->
    <style>
        body {
            background: linear-gradient(120deg, #7f7fd5, #86a8e7, #91eac9);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
            overflow: hidden;
        }
        .welcome-card {
            width: 90%;
            max-width: 500px;
            margin: auto;
            padding: 3rem;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            background: rgba(255,255,255,0.95);
            text-align: center;
            position: relative;
            z-index: 1;
        }
        .welcome-title {
            color: #4a4a4a;
            font-weight: 700;
            font-size: 2rem;
            margin-bottom: 2rem;
        }
        .welcome-message {
            color: #2c3e50;
            font-size: 1.5rem;
            margin-bottom: 2rem;
        }
        .logout-btn {
            background: #7f7fd5;
            color: #fff;
            border: none;
            padding: 12px 30px;
            border-radius: 30px;
            font-size: 1.1rem;
            text-decoration: none;
            display: inline-block;
            transition: transform 0.2s;
        }
        .logout-btn:hover {
            transform: translateY(-2px);
            color: #fff;
        }
        .celebration-container {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 2;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
        }
        .celebration-emoji {
            font-size: 80px;
            animation: celebrate 2s ease-out forwards;
            opacity: 0;
            transform: scale(0);
        }
        .celebration-emoji.left {
            animation-delay: 0.1s;
            transform: scaleX(-1);
        }
        .celebration-emoji.right {
            animation-delay: 0.2s;
        }
        @keyframes celebrate {
            0% {
                transform: scale(0) rotate(-30deg);
                opacity: 0;
            }
            20% {
                transform: scale(1.2) rotate(0deg);
                opacity: 1;
            }
            80% {
                transform: scale(1) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: scale(1) rotate(0deg);
                opacity: 0;
            }
        }
        @media (max-width: 576px) {
            .welcome-card {
                padding: 2rem;
            }
            .welcome-title {
                font-size: 1.8rem;
            }
            .welcome-message {
                font-size: 1.3rem;
            }
            .logout-btn {
                padding: 10px 25px;
                font-size: 1rem;
            }
            .celebration-emoji {
                font-size: 60px;
            }
        }
    </style>
</head>
<body>
    <div class="celebration-container">
        <div class="celebration-emoji left">🎉</div>
        <div class="celebration-emoji right">🎉</div>
    </div>
    <div class="welcome-card">
        <h1 class="welcome-title">登录成功</h1>
        <div class="welcome-message" th:text="'欢迎您，' + ${username} + '！'"></div>
        <a href="/login" class="logout-btn">退出登录</a>
    </div>
</body>
</html>